import type { AddressItem, Logistics, OrderDetail, OrderPre } from "@/types/order";
import { request } from "@/utils/request";
// 药品订单-支付药款页面-根据处方信息计算药款
export const getMedicalOrderPre =(params:{prescriptionId:string})=>
    request<OrderPre>('/patient/medicine/order/pre','GET',params)
// 获取地址
export const getAddressList =()=>
    request<AddressItem[]>('/patient/order/address','GET')
// 生成订单
export const createMedicalOrder =(data:{
    id:string
    couponId:string
    addressId:string
})=>request<{id:string}>('/patient/medicine/order','POST',data)
// 查询药品订单详情
export const getMedicalOrderDetail=(id:string)=>
    request<OrderDetail>(`/patient/medicine/order/detail/${id}`)
// 获取物流信息
export const getMedicalOrderLogistics =(id:string)=>
    request<Logistics>(`/patient/order/${id}/logistics`,'GET')